You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
F-11324 - 9e19c04 - AES-CCM controls now validate tag parameters.
F-8391 - 2a89278 - AES-CCM documentation no longer claims unsupported IV generation.
F-9348 - 6de8e01 - AES-CCM documentation no longer claims unsupported SET_IV handling.
F-10141 - b52e472 - AES-CCM SET_L validation now removes a redundant condition while retaining its stricter lower bound.
Add X9.31 RSA signature leading zero regression test (supersedes #256)
99b1846 - Adds a test that signs a message whose X9.31 signature starts with a zero byte and checks the wolfEngine output against OpenSSL. The left-pad fix from #256 is already covered by F-8360 and F-13064, so only the test is carried over.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
The Windows test project omits a required source file, causing unresolved references with OpenSSL 1.0.2, while logging-observer helpers introduce races and spurious failures in multithreaded debug tests.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
A failed initial PBE registration leaves the PBKDF2 callback installed while initialization remains incomplete, breaking valid OpenSSL PBES2 operations until a later bind succeeds.
No open issues 🎉
1 previously missed issue
In code that hasn't changed since last review
Restore PBKDF2 callback if PBE registration fails
src/we_pbe.c:697
If the final PBE registration fails during the first bind, the already-installed PBKDF2 callback remains in OpenSSL's process-global registry while we_pbe_ready stays zero. Valid PBES2 operations then fail even without wolfEngine, until another bind succeeds. Preserve the previous callbacks and restore them on failure, or delegate to them until registration commits, so a failed engine load does not disable existing OpenSSL PBE functionality.
The reason will be displayed to describe this comment to others. Learn more.
AI says this path can be treated as normal by callers (eg. due to wrong key used), and that the set_error call puts an error in the queue. Worth investigating
The reason will be displayed to describe this comment to others. Learn more.
AI says there is an issue here when copying a context after calling "final" because src->hashType is zero and falls to the BAD_FUNC_ARG at line 1044. Can you add a test case to check it out?
The reason will be displayed to describe this comment to others. Learn more.
AI says there's no test for the min hmac size. Seems important. Can you check?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Combines open PRs #232 to #256 into one PR. Each Fenrir finding keeps its own commit.
Correct AEAD context ownership and reinitialization (supersedes #232, 6 findings)
F-8341- 927da9a - CCM context copies now reject shared ownership without changing the source context.F-10135- f0d5d91 - CCM now initializes its backend before key setup and tracks successful ownership.F-8352- e8e5141 - CCM teardown now releases owned AAD even when backend initialization has not completed.F-8377- ff11826 - CCM reinitialization now releases AAD before resetting its pointer.F-10142- 878b3f9 - CCM now tracks successful initialization direction and per-operation tag validity separately.F-12248- a6a4d09 - Explicit CCM reinitialization now leaves spent TLS dispatch state while retaining per-record header requirements.Release ECDSA result construction temporaries (supersedes #233, 1 finding)
F-10133- a5b3492 - Failed ECDSA result construction now frees r and s BIGNUMs whose ownership was not transferred.Correct engine PBE and MAC ownership (supersedes #234, 31 findings)
F-11322- e174acb - MAC signing now checks the caller's output capacity before writing the result.F-8348- 2e2353b - HMAC raw-key export now checks the caller's output capacity.F-13713- f08d644 - HMAC now reports its maximum output size.F-8344- 2dc304c - MAC updates now reject input lengths that exceed the backend's supported range.F-6450- 566054e - CMAC context copying now reports failures accurately.F-6451- 5e0d8f2 - CMAC key setup now checks whether key assignment succeeds.F-8374- 0320dd0 - CMAC ASN.1 method registration now commits only after setup succeeds.F-10159- 1d3c456 - MAC keys are now cleansed before their storage is released.F-12249- d04d76c - Legacy CMAC keys now retain the correct free dispatch.F-11327- a1bf09e - MAC ASN.1 methods now retain engine-owned lifetime management.F-13040- 029ca20 - CMAC now rejects unsupported cipher selections.F-8347- b674fa5 - MAC state is now cleansed before release.F-8392- fda6a87 - MAC context duplication now skips keys that are not present.F-11325- a552924 - Failed MAC key replacement now preserves the existing key.F-11329- c4a224a - HMAC now preserves the original key length.F-8382- f1d686f - Failed MAC context copies now release partially constructed state.F-11331- 153ad83 - HMAC alignment buffers are now cleansed after use.F-12250- 0bd0f15 - Failed HMAC initialization now cleans up its partial state.F-8351- 71a281f - ECDSA digest registration now uses matching feature guards.F-8368- 3c07564 - PBE registration no longer depends on ECC being enabled.F-8379- c8e6277 - ECDSA teardown now uses feature guards consistent with initialization.F-8390- 7e9bedd - The duplicate FIPS callback definition has been removed.F-11311- c8b70de - Engine teardown now clears released PKEY method pointers.F-12258- 74d1f94 - Mutex initialization failures now produce the correct diagnostic.F-8375- f7bc653 - Legacy PBKDF2 setup now validates its parameters.F-10147- 0655cb1 - Engine binding now requires an exact engine identifier.F-10148- 880ae1a - Failed engine binding now rolls back initialized state.F-11333- 55fa31b - Engine binding and destruction now serialize their shared lifecycle state.F-13063- a3ac1d5 - Process-global PBE callbacks now retain the module lifetime they require.F-10134- 89cb1a4 - MAC ASN.1 key setup now checks key-assignment results.F-5449- 328edcc - MAC string controls now handle the supported control operations.Correct AES CBC HMAC initialization and TLS records (supersedes #235, 14 findings)
F-9347- c5bb9a2 - AES-CBC-HMAC documentation now states the correct IV length.F-10143- d48a14e - AES-CBC-HMAC now supports staged key and IV initialization.F-13041- 039ee8a - Non-TLS AES-CBC-HMAC encryption no longer updates the TLS HMAC state.F-8366- 5b33428 - AES-CBC-HMAC now returns backend encryption failures to the caller.F-10140- b03d001 - AES-CBC-HMAC controls now return standard error results.F-13037- ab76ec8 - TLS CBC-HMAC state now tracks empty records.F-13039- feeec16 - AES-CBC-HMAC now resets TLS framing state between operations.F-10131- e195543 - AES-CBC-HMAC cleanup now releases its cipher state.F-11326- 9f9f839 - CBC-HMAC now rejects malformed record lengths.F-11308- 6716d7f - CBC-HMAC no longer performs TLS authentication checks for non-TLS operations.F-11309- f71917c - CBC-HMAC TLS decryption now accepts extended padding.F-13711- ffc3dd1 - Invalid CBC-HMAC padding no longer corrupts the retained cipher state.F-13067- a2f39f9 - CBC-HMAC now cleanses the temporary record MAC before returning.F-4172- 49b9843 - CBC-HMAC TLS authentication now balances the authentication work across padding cases.Balance DH and ECDH global RNG ownership (supersedes #236, 1 finding)
F-8345- be5b62c - DH and ECDH now release global RNG locks only after successful acquisition.Correct unsupported PKEY control results (supersedes #237, 1 finding)
F-15141- 7bf6b11 - Unknown PKEY controls now return -2 while recognized controls retain their existing behavior.Correct EC verification setup error reporting (supersedes #238, 2 findings)
F-11319- 3303bf5 - EC_KEY verification now reports curve and key setup failures as operational errors.F-12252- 7a81843 - EVP EC verification now reports context and key setup failures as operational errors.Correct legacy EC key operation cleanup (supersedes #239, 7 findings)
F-6182- 9756b3a - Legacy ECDH now clears its temporary shared secret.F-8381- fc22f2f - Legacy EC cleanup now tracks key initialization before RNG setup.F-10132- 1faf160 - ECDH cleanup now tracks key initialization before RNG setup.F-11305- 61cf05c - Legacy ECDH documentation now identifies the output parameter correctly.F-12287- ca49b04 - EC signature capacity is now derived from the key.F-13708- e2aab87 - EC signature-length logging now uses the correct format.F-13712- 3a2c506 - Legacy ECDH KDF failures now produce the correct diagnostic.Correct AES CCM cipher state and results (supersedes #240, 4 findings)
F-6452- b957a66 - AES-CCM failures now produce the correct diagnostic.F-11321- b8d6206 - AES-CCM now uses the standard default tag size.F-10136- 4598615 - Empty AES-CCM updates now report zero output.F-13038- 2871f92 - AES-CCM decryption now preserves its nonce.Correct EC derivation and control contracts (supersedes #241, 11 findings)
F-6630- 3dba458 - ECDH now cleanses the raw shared secret after KDF processing.F-8371- f86ac06 - ECDH peer replacement now resets cached peer state.F-8372- 5652754 - ECDH derivation now rejects contexts without a peer key.F-8373- ffa1a43 - EC operations now propagate curve-size lookup failures.F-10152- dbb9318 - EC derivation now resolves the curve before applying policy checks.F-11310- 23eaa15 - ECDH KDF controls now return the configured output length.F-11328- c5dec39 - ECDH now validates peer groups and point encodings.F-12288- 187dd9d - ECDH now validates KDF configuration before derivation.F-13048- 6af1b25 - EC string controls now require exact control-name matches.F-8362- 74f4370 - ECDH derivation now reports the KDF output length actually written.F-15139- 84d172e - EC parameter string controls now support named curves.Correct EC context ownership and initialization (supersedes #242, 4 findings)
F-4178- 7c8e54f - ECC cleanup now releases RNG state only after successful initialization.F-6175- 77c0291 - EC context cleanup now releases owned ECDH KDF user keying material.F-12251- 649a1d1 - Failed curve-specific EC initialization now cleans up partially initialized state.F-8361- e76e5f0 - EC context copies now own their state independently.Correct RSA PKEY controls and key ownership (supersedes #243, 9 findings)
F-6632- 1cc8058 - RSA signing now checks for context data before accessing the configured digest.F-10128- f7ca1d5 - RSA encryption documentation now identifies the output parameter correctly.F-10129- c6be5c0 - RSA decryption documentation now identifies the output parameter correctly.F-13042- e4ebf06 - RSA controls now distinguish invalid arguments from unsupported operations.F-6176- 007d227 - RSA key generation now preserves the full-width public exponent.F-15138- c37bc88 - RSA key generation now releases transferred exponent storage.F-8342- bb4c5d9 - RSA digest encoding now checks its bounds on every supported OpenSSL version.F-8364- 4dbdb53 - RSA OAEP now honors the caller's label and manages its ownership correctly.F-15135- 5191279 - RSA verify-recovery controls now return the configured digest.Correct DH parameter and derive handling (supersedes #244, 8 findings)
F-8365- e622c82 - Named DH groups now preserve an absent q parameter.F-10145- 9c7621a - DH now releases the RNG mutex only after successful locking.F-11318- 72cc68a - Padded DH derivation now writes a modulus-sized result.F-12253- e8fc300 - DH padding controls now normalize their input consistently.F-12255- 57b7dfc - DH parameter refresh now clears a stale q value.F-12290- 080c651 - DH parameter generation now verifies the generated generator.F-13043- b229743 - DH now allocates the correct object size, with an isolated allocation-test fixture.F-13068- f58c10e - Legacy DH parameter handling now validates prime lengths.Correct digest context and method handling (supersedes #245, 7 findings)
F-9350- 5327ac4 - Generic digest documentation now describes the implementation correctly.F-8378- a671c52 - The direct SHA-1 method now uses the correct identifier.F-10137- 3e93ddb - The ECDSA SHA-1 method now reports the correct block size.F-8367- bff0059 - Failed digest method initialization now clears released global pointers.F-13065- ae94e50 - Digest alignment buffers are now cleansed after use.F-8343- 204006a - Oversized digest updates are now processed in backend-sized chunks.F-10155- 432dd5a - Generic digest context copies now own independent backend state.Correct AES GCM lifecycle and error handling (supersedes #246, 5 findings)
F-12286- 0dae312 - Legacy AES-GCM methods now register their cleanup callback.F-10158- bdc98ef - AES-GCM now bounds accumulated AAD lengths.F-12289- 899636d - AES-GCM backend failures now reach the OpenSSL error queue.F-13055- dd9d483 - AES-GCM control documentation now describes pointer directions correctly.F-13709- a032e40 - AES-GCM logging now uses formats matching its length types.Fix AES CTR context and output handling (supersedes #247, 3 findings)
F-8376- 94f9847 - Empty AES-CTR input now reports zero output.F-9346- 0ccbdb8 - AES-CTR documentation now states the correct IV length.F-10146- 45139c6 - AES-CTR now manages backend initialization and cleanup consistently.Fix random generator state handling (supersedes #248, 4 findings)
F-10144- ac415dd - RAND seeding now returns seed-mixing failures.F-10160- 5cb5fe5 - RAND status now reports whether initialization actually succeeded.F-11332- c19d664 - RAND cleanup now clears supplemental seed state.F-13710- 080b2d8 - RAND entropy logging now formats its floating-point value correctly.Fix AES block cipher lifecycle and results (supersedes #249, 5 findings)
F-8383- ac4bcaf - AES block cipher operations now return zero on failure.F-9345- 1bc2447 - AES-CBC documentation now states the correct IV length.F-10149- a4c1612 - AES block cipher contexts now manage backend initialization and cleanup consistently.F-13046- 6f6cf11 - AES-CBC initialization no longer contains a redundant guard.F-13047- e0b2566 - AES-ECB decryption no longer contains redundant conditions.Correct DES3 cipher lifecycle and IV handling (supersedes #250, 3 findings)
F-8358- b50670f - DES3 now limits IV copies to the IV state being transferred.F-8389- 4ab3ba5 - DES3 decryption failures now produce the correct diagnostic.F-10150- e372bad - DES3 cleanup now releases initialized cipher state.Fix legacy OpenSSL method and EC key handling (supersedes #251, 3 findings)
F-8384- 51062b2 - Legacy method allocation now rejects missing method names.F-8385- 89ab490 - Legacy EC key handling now rejects keys without a private scalar.F-13707- 430fcd2 - Legacy EC private scalars now use padded encodings.Correct TLS PRF state and output handling (supersedes #252, 4 findings)
F-8356- a2761a4 - TLS PRF now rejects unsupported digest selections.F-10138- 78be9f6 - Failed TLS PRF secret setup now clears stale secret state.F-12257- 79c4c9b - TLS PRF now rejects oversized output lengths.F-12269- c82e94c - TLS PRF documentation now describes output parameter directions correctly.Correct RSA method padding and lifecycle handling (supersedes #253, 13 findings)
F-8360- 7c72f41 - RSA X9.31 signing now preserves the required signature width.F-13064- 0b0ea57 - RSA X9.31 operations now use the actual produced width.F-6012- d2e2cf5 - RSA X9.31 operations now report multiprecision failures.F-11314- 1bab7c1 - RSA X9.31 operations now report size errors.F-11320- 45cbc9c - RSA PSS operations now preserve the configured salt length.F-15137- 5585ccd - RSA PSS salt-mode conversion now preserves the selected mode.F-8370- 0845e67 - RSA cleanup no longer unlocks an RNG mutex that was not acquired.F-12254- 8a56082 - RSA operations now report RNG mutex lock failures.F-6453- d92f630 - RSA X9.31 operations now lock access to the global RNG.F-8380- 925df9f - RSA public-key import now rejects negative encoding lengths.F-11306- e7c1c65 - RSA private-key import documentation now describes the implementation correctly.F-11313- fb3acf6 - RSA private-key import now rejects negative encoding lengths.F-13066- c714db5 - RSA method handling no longer contains an unreachable digest check.Correct HKDF state and output handling (supersedes #254, 7 findings)
F-6183- e3c174b - HKDF extract mode now supports output-size queries.F-8350- d4560b4 - Failed HKDF key setup now clears stale key state.F-10139- dc00503 - Failed HKDF salt setup now clears stale salt state.F-11312- 0b3a82c - HKDF now rejects unsupported digest selections.F-12256- d3229f8 - HKDF now rejects oversized output requests.F-13044- 8ac69dd - HKDF now accepts empty keys.F-15140- 3b827ff - HKDF key setup now preserves previously configured info.Correct AES CCM control validation (supersedes #255, 8 findings)
F-13056- cf5590b - AES-CCM control documentation now describes pointer directions correctly.F-11323- f43824b - AES-CCM controls now reject undersized nonces.F-10130- 8422d0e - The AES-CCM IV-length getter comment now describes the actual result.F-11317- 8473507 - AES-CCM fixed-IV setup now rejects null input.F-11324- 9e19c04 - AES-CCM controls now validate tag parameters.F-8391- 2a89278 - AES-CCM documentation no longer claims unsupported IV generation.F-9348- 6de8e01 - AES-CCM documentation no longer claims unsupported SET_IV handling.F-10141- b52e472 - AES-CCM SET_L validation now removes a redundant condition while retaining its stricter lower bound.Add X9.31 RSA signature leading zero regression test (supersedes #256)
99b1846 - Adds a test that signs a message whose X9.31 signature starts with a zero byte and checks the wolfEngine output against OpenSSL. The left-pad fix from #256 is already covered by F-8360 and F-13064, so only the test is carried over.